package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;

/**
 * 林地指标平台_林地指标变更记录表 实体类。
 *
 * @author 11987
 * @since 2025-05-13
 */
@Table(value = "LINDI_INDEX_CHANGE_RECORD", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiIndexChangeRecord extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 指标变更记录ID
     */
    private Long indexChangeRecordId;

    /**
     * 镇街名称
     */
    private String townName;

    /**
     * 变更亩数
     */
    private String changeQuantity;

    /**
     * 交易指标申请ID
     */
    private String tradeApplicationId;

    // 无参构造函数
    public LindiIndexChangeRecord() {
    }

    // 全参构造函数
    public LindiIndexChangeRecord(Long indexChangeRecordId, String townName, String changeQuantity, String tradeApplicationId) {
        this.indexChangeRecordId = indexChangeRecordId;
        this.townName = townName;
        this.changeQuantity = changeQuantity;
        this.tradeApplicationId = tradeApplicationId;
    }

    // Getter和Setter方法
    public Long getIndexChangeRecordId() {
        return indexChangeRecordId;
    }

    public void setIndexChangeRecordId(Long indexChangeRecordId) {
        this.indexChangeRecordId = indexChangeRecordId;
    }

    public String getTownName() {
        return townName;
    }

    public void setTownName(String townName) {
        this.townName = townName;
    }

    public String getChangeQuantity() {
        return changeQuantity;
    }

    public void setChangeQuantity(String changeQuantity) {
        this.changeQuantity = changeQuantity;
    }

    public String getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(String tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiIndexChangeRecord that = (LindiIndexChangeRecord) o;
        return java.util.Objects.equals(indexChangeRecordId, that.indexChangeRecordId) &&
               java.util.Objects.equals(townName, that.townName) &&
               java.util.Objects.equals(changeQuantity, that.changeQuantity) &&
               java.util.Objects.equals(tradeApplicationId, that.tradeApplicationId);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(super.hashCode(), indexChangeRecordId, townName, changeQuantity, tradeApplicationId);
    }

    @Override
    public String toString() {
        return "LindiIndexChangeRecord{" +
               "indexChangeRecordId=" + indexChangeRecordId +
               ", townName='" + townName + '\'' +
               ", changeQuantity='" + changeQuantity + '\'' +
               ", tradeApplicationId='" + tradeApplicationId + '\'' +
               "} " + super.toString();
    }

    // Builder类
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long indexChangeRecordId;
        private String townName;
        private String changeQuantity;
        private String tradeApplicationId;

        public Builder indexChangeRecordId(Long indexChangeRecordId) {
            this.indexChangeRecordId = indexChangeRecordId;
            return this;
        }

        public Builder townName(String townName) {
            this.townName = townName;
            return this;
        }

        public Builder changeQuantity(String changeQuantity) {
            this.changeQuantity = changeQuantity;
            return this;
        }

        public Builder tradeApplicationId(String tradeApplicationId) {
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public LindiIndexChangeRecord build() {
            return new LindiIndexChangeRecord(indexChangeRecordId, townName, changeQuantity, tradeApplicationId);
        }
    }

}
